package com.qiaofang.applet.service.member.repository;

import com.qiaofang.applet.service.member.domain.Member;
import com.qiaofang.applet.service.member.domain.MemberFocus;
import com.qiaofang.applet.service.member.service.dto.MemberEmpDto;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author daiyuxiang
 */
@Repository
public interface MemberRepository extends MongoRepository<Member, String> {

    Member findByMobilePhoneAndCorporationCode(String mobilePhone, String corporationCode);

    Member findByCorporationCodeAndId(String corporationCode, String id);

    Member findFirstByCorporationCodeAndOpenid(String corporationCode, String openId);

    Member findFirstByCorporationCodeAndEmployeeUniqueUuid(String corporationCode, String uniqueUuid);

    List<Member> findAllByCorporationCodeAndIdIn(String corporationCode, List<String> memberIds);

    List<Member> findAllByCorporationCodeAndEmployeeUniqueUuidIn(String corporationCode, List<String> uniqueUuids);

    List<Member> findListByIdIn(List<String> memberIds);

    List<MemberEmpDto> findAllByIdIn(List<String> memberIds);

}
